package com.xbang.attendance.web.action.warehouse.stock;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.xbang.attendance.entity.order.DeliveryOrder;
import com.xbang.attendance.entity.stock.Inventory;
import com.xbang.attendance.service.DeliveryOrderService;
import com.xbang.attendance.service.InventoryService;
import com.demo2do.lighturl.annotation.Action;
import com.xbang.core.page.Result;
import com.xbang.core.struts.support.SearchActionSupport;

public class DeliverylistDetailSearch extends SearchActionSupport {
	
	@Autowired
	private InventoryService inventoryService;
	
	@Autowired
	private DeliveryOrderService deliveryOrderService;
	
	private List<DeliveryOrder> deliveryOrders = new ArrayList<DeliveryOrder>();
	
	/** 库存列表 */
	private List<Inventory> inventorysTemp = new ArrayList<Inventory>();
	
	private Integer id;
	
	private String wareHouseCode;
	
	private String productCode;
	
	@Action("/warehouse/stock-deliverylist-detail/list/${wareHouseCode}")
	public String list() throws Exception {
		String hqlSentence = "FROM DeliveryOrder deliveryorder WHERE 1 = 1";
		searchComponent.addSearchElement("eq.deliveryorder.warehouse.code", wareHouseCode);
		Result result = deliveryOrderService.searchByPage(hqlSentence, searchComponent, page);

		deliveryOrders = result.getItems();

		page = result.getPage();

		return "stock-deliverylist-detail-search";
	}

	@Override
	public void resetCustomerSearchCriteria() {
		// TODO Auto-generated method stub
		
	}

	public InventoryService getInventoryService() {
		return inventoryService;
	}

	public void setInventoryService(InventoryService inventoryService) {
		this.inventoryService = inventoryService;
	}

	public DeliveryOrderService getDeliveryOrderService() {
		return deliveryOrderService;
	}

	public void setDeliveryOrderService(DeliveryOrderService deliveryOrderService) {
		this.deliveryOrderService = deliveryOrderService;
	}

	public List<DeliveryOrder> getDeliveryOrders() {
		return deliveryOrders;
	}

	public void setDeliveryOrders(List<DeliveryOrder> deliveryOrders) {
		this.deliveryOrders = deliveryOrders;
	}

	public List<Inventory> getInventorysTemp() {
		return inventorysTemp;
	}

	public void setInventorysTemp(List<Inventory> inventorysTemp) {
		this.inventorysTemp = inventorysTemp;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getProductCode() {
		return productCode;
	}

	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}

	public String getWareHouseCode() {
		return wareHouseCode;
	}

	public void setWareHouseCode(String wareHouseCode) {
		this.wareHouseCode = wareHouseCode;
	}
	
	
	
}
	